/*
 *
 * Copyright (c) 2025 Bocloud Technologies Co., Ltd.
 * installer is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain n copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 *
 */
package v1beta1

import (
	"testing"

	confv1beta1 "gopkg.openfuyao.cn/bkecommon/cluster/api/v1beta1"
)

func TestBkeClusterTypes(t *testing.T) {
	t.Run("BKECluster", func(t *testing.T) {

		ip := "localhost"
		ipNot := "localhost1"
		msg := "this is ready"
		state := confv1beta1.NodeStates(NodeReady)
		stateCode := 1
		bkeCluster := &BKECluster{
			Status: confv1beta1.BKEClusterStatus{
				NodesStatus: confv1beta1.NodesStates{
					{
						Node: confv1beta1.Node{
							IP: ip,
						},
						State:     NodeReady,
						StateCode: stateCode,
					},
				},
			},
		}

		bkeCluster.MarkNodeStateFlag(ip, stateCode)
		bkeCluster.MarkNodeStateFlag(ipNot, stateCode)

		bkeCluster.UnmarkNodeState(ip, stateCode)
		bkeCluster.UnmarkNodeState(ipNot, stateCode)

		bkeCluster.GetNodeStateFlag(ip, stateCode)
		bkeCluster.GetNodeStateFlag(ipNot, stateCode)

		bkeCluster.GetNodeState(ip)
		bkeCluster.GetNodeState(ipNot)
		bkeCluster.SetNodeStateWithMessage(ip, state, msg)
		bkeCluster.SetNodeStateWithMessage(ipNot, state, msg)
		bkeCluster.SetNodeState(ip, state)
		bkeCluster.SetNodeState(ipNot, state)
		bkeCluster.SetNodeStateMessage(ip, msg)
		bkeCluster.SetNodeStateMessage(ipNot, msg)
		bkeCluster.RemoveNodeState(ip)
		bkeCluster.RemoveNodeState(ipNot)
		bkeCluster.GetNodeStateNeedSkip(ip)
		bkeCluster.SetNodeStateNeedSkip(ip, true)

		var nilBkeCluster *BKECluster
		if nilBkeCluster == nil {
			nilBkeCluster.DeepCopy()
			nilBkeCluster.DeepCopyObject()
		}

	})
}
